package com.biz.primus.ms.commodity.trans;

import com.biz.primus.commodity.vo.backend.ProductSubHeadVo;
import com.biz.primus.ms.commodity.dao.po.Product;
import com.google.common.base.Function;
import javax.annotation.Nullable;


/**
 * Created by aaa on 2017/7/19.
 */
public class Product2ProductSubHeadVo implements Function<Product, ProductSubHeadVo> {
    @Nullable
    @Override
    public ProductSubHeadVo apply(@Nullable Product input) {
        ProductSubHeadVo resp = new ProductSubHeadVo();
//        if (input.getCategory() != null){
//            resp.setCategoryName(input.getCategory().getName());
//        }
        resp.setProductCode(input.getProductCode());
        resp.setProductId(String.valueOf(input.getId()));
        resp.setProductName(input.getName());
        resp.setSubHeadingMark(input.getSubHeadingMark());
        resp.setSubMark(input.getSubTitle());
        return resp;
    }
}
